﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Pay.DTO
{
    /// <summary>
    /// 活动表 mc_Activity
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class activity_dto
    {
        /// <summary>
        /// 活动Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 活动类型（枚举）
        /// </summary>
        public EActivityType type { get; set; }

        /// <summary>
        /// 活动类型枚举描述
        /// </summary>
        public string type_title { get { return this.type.ToDescription(); } }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 图片Url
        /// </summary>
        public string img_url { get; set; }

        /// <summary>
        /// 连接地址
        /// </summary>
        public string link_url { get; set; }

        /// <summary>
        /// 活动说明
        /// </summary>
        public string detail { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime begin_time { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime end_time { get; set; }

        /// <summary>
        /// 点击数
        /// </summary>
        public int click_num { get; set; }

        /// <summary>
        /// 参与数
        /// </summary>
        public int participation_num { get; set; }

        /// <summary>
        /// 状态（枚举）
        /// </summary>
        public EActivityStatus status { get; set; }

        /// <summary>
        /// 活动状态枚举描述
        /// </summary>
        public string status_title { get { return this.status.ToDescription(); } }

        /// <summary>
        /// 开始预热时间
        /// </summary>
        public DateTime? preheat_time { get; set; }

        /// <summary>
        /// 首页是否显示
        /// </summary>
        public bool is_index_show { get; set; }
    }

    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class activity_dto_ex : activity_dto
    {
        /// <summary>
        /// 活动类型枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_activity_type_list
        {
            get { return typeof(EActivityType).GetDropdownItemList(); }
        }
        /// <summary>
        /// 活动类型枚举值
        /// </summary>
        public string activity_type_value { get; set; }

        /// <summary>
        /// 状态枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_status_list
        {
            get { return typeof(EActivityStatus).GetDropdownItemList(); }
        }
        /// <summary>
        /// 状态枚举值
        /// </summary>
        public string status_value { get; set; }

    }
}